Page({
  data: {
    user: {
      nickName: '',
      avatar: ''
    }
  },
  onShow() {
    this.getUser()
  },
  async getUser() {
    const { data } = await wx.http.get('/userInfo')
    wx.setStorageSync('share-user', data);
    this.setData({
      user: data
    })
  },
  goLogin() {
    wx.navigateTo({
      url: '/pages/login/index',
    })
  },
})
